/**
 * Created by Administrator on 2015/6/16.
 */
define(['jquery'],function($){
   function GetTalk(id){
       $.ajax({
           type: "POST",
           url: "/talklist",
           data: {id:$('.user-talk-enter').attr('data-articleid')},
           dataType:'json',
           success: function(msg){
               if(msg.success==1){
                   var html='';
                   if(msg.list.length>0){
                       for(var i=0;i<msg.list.length;i+=2){
                           var t=i+1;
                           html+='<div class="talk-list-div clearfix"><a href="javascript:void(0)"><img src="/upload/userphoto/'+msg.list[t].img
                           +'"></a><p class="talk-nickname">'+msg.list[t].name+'：</p> <div class="talk-content">'+msg.list[i].content+'</div><p class="talk-date">发布时间：'+
                           new Date(msg.list[i].date).getFullYear()+"-"+(new Date(msg.list[i].date).getMonth()+1)+"-"+new Date(msg.list[i].date).getDate()+' '+
                           new Date(msg.list[i].date).getHours()+':'+new Date(msg.list[i].date).getMinutes()+'</p></div>';
                       }
                   }
                   $('.user-talk-list').html(html);
               }else{
                   $('.user-talk-list').html('暂无任何评论');
               }
           }
       })
   }//获取改文章用户评论

    return {
        GetTalk:GetTalk

    }
});